
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 2509. -- 送分题 -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>2509: 送分题</h2><span class=green>Time Limit: </span>10 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>128 MB<br><span class=green>Submit: </span>14&nbsp;&nbsp;<span class=green>Solved: </span>6<br>[<a href='submitpage.php?id=2509'>Submit</a>][<a href='problemstatus.php?id=2509'>Status</a>][<a href='bbs.php?id=2509'>Discuss</a>]</center><h2>Description</h2><div class=content><div style="text-indent: 20.25pt"><span style="font-size: medium">给出平面上的<i>M</i>条平行于坐标轴的线段，问有多少个正方形。</span></div>
<div style="text-indent: 20.25pt"><span style="font-size: medium">&nbsp;</span></div></div><h2>Input</h2><div class=content><div style="text-indent: 20.25pt"><span style="font-size: medium">第1行为两个正整数<i>N</i>，<i>M</i>。</span></div>
<div style="text-indent: 20.25pt"><span style="font-size: medium">接下来<i>M</i>行，每行4个非负整数<i>x</i><sub>1</sub>，<i>y</i><sub>1</sub>，<i>x</i><sub>2</sub>，<i>y</i><sub>2</sub>（0&le;<i>x</i><sub>1</sub>&le;<i>x</i><sub>2</sub>&le;<i>N</i>，0&le;<i>y</i><sub>1</sub>&le;<i>y</i><sub>2</sub>&le;<i>N</i>），描述了线段的两个端点。</span></div>
<div><span style="font-size: medium">&nbsp;</span></div></div><h2>Output</h2><div class=content><div style="text-indent: 20.25pt"><span style="font-size: medium">仅包括一个正整数，为平面上正方形的个数。</span></div>
<div style="text-indent: 20.25pt"><span style="font-size: medium">&nbsp;</span></div></div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>3 8<br />
0 0 0 3<br />
1 0 1 3<br />
2 0 2 2<br />
3 0 3 3<br />
0 0 3 0<br />
0 1 3 1<br />
0 2 3 2<br />
0 3 3 3<br />
 <br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>11<br />
 <br />
</span></div><h2>HINT</h2>
			<div class=content><p><p>【样例说明】<br /><br />
样例对应了如下一张图<br /><br />
其中边长为1的正方形有7个，边长为2的正方形有3个，边长为3的正方形有1个。<br /><br />
所以答案为7+3+1=11。<br /><br />
&nbsp;<br /><br />
【数据规模】<br /><br />
对于20%的数据，有N&le;30；<br /><br />
对于40%的数据，有N&le;100；<br /><br />
对于60%的数据，有N&le;800； <br /><br />
对于100%的数据，有N&le;1000，M&le;400000，并保证任意两条线段没有重合部分。</p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=2011福建集训'>2011福建集训</a></p></div><center>[<a href='submitpage.php?id=2509'>Submit</a>][<a href='problemstatus.php?id=2509'>Status</a>][<a href='bbs.php?id=2509'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
